﻿/**********************************************************************
 * @file   SemiInfiniteFluidDialog.h
 * @brief  半无线流体对话框
 * @author BaGuijun (baguijun@163.com)
 * @date   2024-11-12
 *********************************************************************/
#ifndef _SemiInfiniteFluidDialog_H
#define _SemiInfiniteFluidDialog_H

#include "GUISubSystemDialogAPI.h"
#include "GUIWidget/GUIDialogBase.h"

class QComboBox;

namespace Ui {
    class SemiInfiniteFluidDialog;
}

namespace Acoustics {
    class FITKSEASubSysSemiInfiniteFluid;
}

namespace EventOper {
    class ParaWidgetInterfaceOperator;
}

namespace GUI
{
    /**
     * @brief  半无线流体对话框
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-11-12
     */
    class GUISubSystemDialogAPI SemiInfiniteFluidDialog :public GUIDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief    构造函数
         * @param[i] dataID        数据id
         * @param[i] oper          操作器
         * @param[i] isCreate      是否创建
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        SemiInfiniteFluidDialog(int dataID, EventOper::ParaWidgetInterfaceOperator* oper, bool isCreate);
        /**
         * @brief    析构函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        ~SemiInfiniteFluidDialog();
        /**
         * @brief    初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void init();
        /**
         * @brief    设置节点id
         * @param[i] nodeID
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-15
         */
        void setNodeID(int nodeID);
    protected:
        /**
         * @brief    显示事件
         * @param[i] event                 事件对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-16
         */
        void showEvent(QShowEvent* event);
        /**
         * @brief    取消高亮
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void disHight();
    protected slots:
        ;
        /**
         * @brief    确认事件重写
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void accept() override;
        /**
         * @brief    取消事件重写
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void reject() override;
    private slots:
        ;
        /**
         * @brief    OK按钮点击事件
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-13
         */
        void on_pushButton_Ok_clicked();
        /**
         * @brief    取消按钮点击事件
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-13
         */
        void on_pushButton_Cancel_clicked();
        /**
         * @brief    连接子系统删除事件
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-15
         */
        void on_pushButton_Remove_clicked();
        void on_checkBox_Override_clicked();
    private:
        /**
         * @brief    创建初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void InitCreate();
        /**
         * @brief    编辑初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void InitEdit();
        /**
         * @brief    创建确定
         * @return   bool         是否成功
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        bool OKCreate();
        /**
         * @brief    编辑确定
         * @return   bool         是否成功
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        bool OKEdit();
        /**
         * @brief    将界面数据填充至数据对象中
         * @param[i] data     数据对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void getDataFromWidget(Acoustics::FITKSEASubSysSemiInfiniteFluid* data);
        /**
         * @brief    将数据对象中的数据填充至界面
         * @param[i] data     数据对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void setDataToWidget(Acoustics::FITKSEASubSysSemiInfiniteFluid* data);
    private:
        /**
         * @brief    更新node表格
         * @param[i] nodeID    点id
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-15
         */
        void updateNodeTable(int nodeID);
        /**
         * @brief    更新连接子系统
         * @param[i] data      半无线流体对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-15
         */
        void updateConnectSubsys(Acoustics::FITKSEASubSysSemiInfiniteFluid* data);
        /**
         * @brief    创建损耗因子下拉框
         * @return   QComboBox*          下拉框对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-22
         */
        QComboBox* createRadLossFactor();
    private:
        /**
         * @brief  ui对象
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-12
         */
        Ui::SemiInfiniteFluidDialog* _ui = nullptr;
        /**
         * @brief  操作器
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-12
         */
        EventOper::ParaWidgetInterfaceOperator* _oper = nullptr;
        /**
         * @brief  当前数据id
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-12
         */
        int _currentDataID = -1;
        /**
         * @brief  是否创建
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-12
         */
        bool _isCreate = false;
    };
}
#endif
